package com.mori.design.pattern.singleton;

/**
 * 单例：双重检测锁式
 * @author mori
 */
public class SingletonDoubleLockCheck {

    private static volatile SingletonDoubleLockCheck INSTANCE = null;

    private SingletonDoubleLockCheck() {
    }

    public static SingletonDoubleLockCheck getInstance() {
        if (INSTANCE == null) {
            synchronized (SingletonDoubleLockCheck.class) {
                if (INSTANCE == null) {
                    INSTANCE = new SingletonDoubleLockCheck();
                }
            }
        }
        return INSTANCE;
    }
}
